package com.weic.controller;

import com.weic.mapper.DeptMapper;
import com.weic.pojo.Dept;
import com.weic.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(value = "/freeMarker")
public class FreeMarkerController {

    @Autowired
    DeptService deptService;

    @RequestMapping(value = "/show")
    public String freeMarker(Map<String,Object> map){
        List<Dept> deptList = deptService.getAll(0,4);
        map.put("deptList",deptList);
        map.put("today",new Date());
        return "show";
    }
}
